/**
 * CopyRight(C) HNA eKing Tech co,.cl
 * @Author ke_wan
 * @date 2014-5-14
 */
package com.hnas.sys.service.system.mapper;

import com.hnas.core.mapper.Mapper;
import com.hnas.sys.orm.UserAuthority;
import com.hnas.sys.service.system.dto.DTOUserAuthority;

/**
 * @author ke_wan
 *
 */
public class UserAuthorityMapper extends Mapper<DTOUserAuthority, UserAuthority>{
private static UserAuthorityMapper userAuthorityMapper;
	
	private UserAuthorityMapper() {
		super(DTOUserAuthority.class, UserAuthority.class);
	}
	
	public static UserAuthorityMapper getInstance() {
		if (userAuthorityMapper == null) {
			userAuthorityMapper = new UserAuthorityMapper();
		}
		return userAuthorityMapper;
	}
	
	public DTOUserAuthority mapToValue(UserAuthority entity){
		DTOUserAuthority value = new DTOUserAuthority();
		value.setId(entity.getId());
//		value.setUserName(entity.getUser().getUserName());
//		value.setUserNo(entity.getUser().getUserNo());
//		value.setDepartmentName(entity.getUser().getDepartmentName());
		value.setAuthorityName(entity.getAuthority().getName());
		return value;
		
	}

}
